﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.Runtime.Serialization;



namespace MoviTiendas.Logica
{
    [DataContract]
    public class Producto
    {
         [DataMember]
        public String nombre { get; set; }
        
        public List<Item> items { get; set; }
         [DataMember]
        public String imagen { get; set; }


        public Producto(String nombre, String urlImagen )
        {
            this.nombre = nombre;
            this.imagen = urlImagen;
            items = new List<Item>();

        }


        public void agregarItem(Item item)
        {
 
                items.Add(item);
            
        }

        public void agregarItems(List<Item> items)
        {

            foreach (Item item in items)
            {
                if (!items.Contains(item))
                {
                    items.Add(item);
                }
            }
        }           
    }   
}
